try: from visual import *
except IOError: pass


scene=display()
scene.title='Optical tracking. Plotting 3D. Front view.'
scene.width=400
scene.height=400
scene.autoscale=False
scene.x=80             #
scene.y=40              #
scene.fullscreen=False
scene.exit=False
srr=frame()
scene.forward=(0,0,-1)
scene.up=(0,1,0)
scene.uniform=0
scene.range=(500,500,25)  #
scene.center=(550, 400, -50)



centers=[array([300,300]),array([749, 374])]

c0=curve(frame=srr,color=color.yellow, pos=centers[0], radius=3)
c1=curve(frame=srr,color=color.green, pos=centers[1], radius=3)





c0.pos=array([[ 300. ,  300. ,    0. ],
       [ 326. ,  271.5,    0. ],
       [ 325. ,  276.5,   -1. ],
       [ 325. ,  278.5,   -2. ],
       [ 325.5,  283. ,   -3. ],
       [ 329.5,  289.5,   -4. ],
       [ 334. ,  295. ,   -5. ],
       [ 336.5,  296.5,   -6. ],
       [ 335.5,  299. ,   -7. ],
       [ 337. ,  300. ,   -8. ],
       [ 337. ,  304. ,   -9. ],
       [ 337. ,  306.5,  -10. ],
       [ 339. ,  310. ,  -11. ],
       [ 341. ,  317. ,  -12. ],
       [ 343.5,  322.5,  -13. ],
       [ 350. ,  330.5,  -14. ],
       [ 356.5,  339.5,  -15. ],
       [ 366. ,  351. ,  -16. ],
       [ 374.5,  362. ,  -17. ],
       [ 383. ,  372. ,  -18. ],
       [ 386.5,  383.5,  -19. ],
       [ 392. ,  392. ,  -20. ],
       [ 392. ,  391. ,  -21. ],
       [ 386.5,  388. ,  -22. ],
       [ 379.5,  378.5,  -23. ],
       [ 373.5,  366. ,  -24. ],
       [ 368.5,  351. ,  -25. ],
       [ 360.5,  336.5,  -26. ],
       [ 353. ,  323.5,  -27. ],
       [ 341. ,  310.5,  -28. ],
       [ 327.5,  301.5,  -29. ],
       [ 314.5,  297. ,  -30. ],
       [ 295. ,  294.5,  -31. ],
       [ 279. ,  294.5,  -32. ],
       [ 263. ,  296.5,  -33. ],
       [ 254. ,  304. ,  -34. ],
       [ 251.5,  318. ,  -35. ],
       [ 256.5,  333.5,  -36. ],
       [ 265.5,  351. ,  -37. ],
       [ 282.5,  369. ,  -38. ],
       [ 299. ,  385.5,  -39. ],
       [ 315.5,  398. ,  -40. ],
       [ 332. ,  409.5,  -41. ],
       [ 344. ,  422.5,  -42. ],
       [ 350. ,  429. ,  -43. ],
       [ 353.5,  432.5,  -44. ],
       [ 361. ,  430.5,  -45. ],
       [ 366.5,  423.5,  -46. ],
       [ 373. ,  416.5,  -47. ],
       [ 376.5,  397. ,  -48. ],
       [ 373.5,  369. ,  -49. ],
       [ 361. ,  347. ,  -50. ],
       [ 350. ,  326.5,  -51. ],
       [ 337. ,  307.5,  -52. ],
       [ 317. ,  291.5,  -53. ],
       [ 302. ,  279. ,  -54. ],
       [ 285.5,  270.5,  -55. ],
       [ 275. ,  274. ,  -56. ],
       [ 263.5,  274.5,  -57. ],
       [ 247. ,  276. ,  -58. ],
       [ 237. ,  284. ,  -59. ],
       [ 229.5,  292. ,  -60. ],
       [ 223. ,  300. ,  -61. ],
       [ 219.5,  310. ,  -62. ],
       [ 220.5,  315. ,  -63. ],
       [ 225.5,  315. ,  -64. ],
       [ 234.5,  314. ,  -65. ],
       [ 244.5,  310.5,  -66. ],
       [ 256.5,  309. ,  -67. ],
       [ 274.5,  308.5,  -68. ],
       [ 286. ,  302.5,  -69. ],
       [ 293.5,  291. ,  -70. ],
       [ 303. ,  281.5,  -71. ],
       [ 312. ,  267.5,  -72. ],
       [ 324.5,  246. ,  -73. ],
       [ 334.5,  232. ,  -74. ],
       [ 348.5,  228.5,  -75. ],
       [ 353. ,  225.5,  -76. ],
       [ 346. ,  221.5,  -77. ],
       [ 341. ,  233. ,  -78. ],
       [ 320. ,  247.5,  -79. ],
       [ 313. ,  269. ,  -80. ],
       [ 311.5,  289. ,  -81. ],
       [ 298. ,  295.5,  -82. ],
       [ 298.5,  316.5,  -83. ],
       [ 290.5,  320. ,  -84. ],
       [ 289. ,  322.5,  -85. ],
       [ 289. ,  331.5,  -86. ],
       [ 281.5,  330.5,  -87. ],
       [ 284. ,  329.5,  -88. ],
       [ 277. ,  331.5,  -89. ],
       [ 276. ,  334.5,  -90. ],
       [ 276.5,  344.5,  -91. ],
       [ 280. ,  354.5,  -92. ],
       [ 291. ,  370. ,  -93. ],
       [ 304.5,  384. ,  -94. ],
       [ 320.5,  400. ,  -95. ],
       [ 337. ,  416. ,  -96. ],
       [ 356. ,  432. ,  -97. ],
       [ 372.5,  453. ,  -98. ],
       [ 387. ,  473. ,  -99. ],
       [ 397. ,  490. , -100. ]])

c1.pos=array([[ 749. ,  374. ,    0. ],
       [ 781. ,  321. ,    0. ],
       [ 778.5,  325.5,   -1. ],
       [ 778.5,  330. ,   -2. ],
       [ 778.5,  334.5,   -3. ],
       [ 780.5,  343. ,   -4. ],
       [ 784.5,  347. ,   -5. ],
       [ 786. ,  350. ,   -6. ],
       [ 786. ,  352.5,   -7. ],
       [ 788. ,  355.5,   -8. ],
       [ 785.5,  360. ,   -9. ],
       [ 786. ,  362.5,  -10. ],
       [ 787. ,  369. ,  -11. ],
       [ 789. ,  376. ,  -12. ],
       [ 791.5,  383.5,  -13. ],
       [ 797.5,  391.5,  -14. ],
       [ 803.5,  401.5,  -15. ],
       [ 812. ,  416. ,  -16. ],
       [ 821. ,  430.5,  -17. ],
       [ 827.5,  442. ,  -18. ],
       [ 832. ,  456. ,  -19. ],
       [ 837.5,  468. ,  -20. ],
       [ 839.5,  471.5,  -21. ],
       [ 838. ,  473. ,  -22. ],
       [ 834. ,  464.5,  -23. ],
       [ 832.5,  453. ,  -24. ],
       [ 833. ,  439.5,  -25. ],
       [ 831. ,  426.5,  -26. ],
       [ 830.5,  414.5,  -27. ],
       [ 827. ,  402.5,  -28. ],
       [ 818.5,  394.5,  -29. ],
       [ 812.5,  391. ,  -30. ],
       [ 800. ,  387.5,  -31. ],
       [ 786.5,  391. ,  -32. ],
       [ 775. ,  396. ,  -33. ],
       [ 764. ,  408.5,  -34. ],
       [ 762. ,  425.5,  -35. ],
       [ 764. ,  448.5,  -36. ],
       [ 769.5,  472. ,  -37. ],
       [ 783.5,  495.5,  -38. ],
       [ 797.5,  515.5,  -39. ],
       [ 811. ,  533. ,  -40. ],
       [ 822. ,  547. ,  -41. ],
       [ 828. ,  568. ,  -42. ],
       [ 830.5,  578.5,  -43. ],
       [ 830. ,  588. ,  -44. ],
       [ 832.5,  587.5,  -45. ],
       [ 836. ,  586. ,  -46. ],
       [ 841.5,  584.5,  -47. ],
       [ 846. ,  567. ,  -48. ],
       [ 844.5,  541. ,  -49. ],
       [ 835. ,  519. ,  -50. ],
       [ 827.5,  499.5,  -51. ],
       [ 819. ,  482.5,  -52. ],
       [ 803.5,  467.5,  -53. ],
       [ 790.5,  457.5,  -54. ],
       [ 777. ,  449. ,  -55. ],
       [ 767. ,  453.5,  -56. ],
       [ 757. ,  456. ,  -57. ],
       [ 741. ,  462.5,  -58. ],
       [ 729.5,  477. ,  -59. ],
       [ 719.5,  490. ,  -60. ],
       [ 708.5,  504. ,  -61. ],
       [ 702.5,  523.5,  -62. ],
       [ 698.5,  537. ,  -63. ],
       [ 699.5,  546. ,  -64. ],
       [ 705. ,  554.5,  -65. ],
       [ 711.5,  557. ,  -66. ],
       [ 721.5,  561.5,  -67. ],
       [ 734.5,  568.5,  -68. ],
       [ 747. ,  569.5,  -69. ],
       [ 752. ,  562. ,  -70. ],
       [ 761. ,  554.5,  -71. ],
       [ 772. ,  545.5,  -72. ],
       [ 786. ,  523. ,  -73. ],
       [ 799.5,  506.5,  -74. ],
       [ 819.5,  492.5,  -75. ],
       [ 829.5,  474.5,  -76. ],
       [ 834.5,  443.5,  -77. ],
       [ 836. ,  434.5,  -78. ],
       [ 821. ,  429. ,  -79. ],
       [ 819. ,  430. ,  -80. ],
       [ 819. ,  434. ,  -81. ],
       [ 809.5,  428. ,  -82. ],
       [ 810.5,  429.5,  -83. ],
       [ 803. ,  423. ,  -84. ],
       [ 801.5,  414.5,  -85. ],
       [ 796.5,  415. ,  -86. ],
       [ 788. ,  403. ,  -87. ],
       [ 786.5,  393.5,  -88. ],
       [ 781. ,  389.5,  -89. ],
       [ 774.5,  386. ,  -90. ],
       [ 773.5,  385. ,  -91. ],
       [ 772.5,  388.5,  -92. ],
       [ 778. ,  396. ,  -93. ],
       [ 784.5,  406.5,  -94. ],
       [ 796. ,  420. ,  -95. ],
       [ 804.5,  432.5,  -96. ],
       [ 818. ,  447.5,  -97. ],
       [ 827.5,  472. ,  -98. ],
       [ 835.5,  489.5,  -99. ],
       [ 845. ,  509. , -100. ]])

scene2=visual.display()
scene2.title='Optical tracking. Plotting 3D. Side view.'
scene2.width=500
scene2.height=400
scene2.autoscale=False
scene2.x=500             #
scene2.y=40              #
scene2.fullscreen=False
scene2.exit=False
srr2=frame()
scene2.forward=(1,0,0)
scene2.up=(0,1,0)
scene2.uniform=0
scene2.range=(500,500,10)  #
scene2.center=(550, 400, -50)

c0b=curve(frame=srr2,color=color.yellow, pos=centers[0], radius=3)
c1b=curve(frame=srr2,color=color.green, pos=centers[1], radius=3)
c0b.pos=c0.pos
c1b.pos=c1.pos
